﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace KinConquer.Packets.Structures
{
    [StructLayout(LayoutKind.Explicit)]
    public unsafe struct NewHero
    {
        [FieldOffset(0)]
        public ushort Size;
        [FieldOffset(2)]
        public ushort Type;
        [FieldOffset(4)]
        public ushort Action;

        [FieldOffset(24)]
        private fixed sbyte szCharacterName[16];

        [FieldOffset(72)]
        public ushort Mesh;
        [FieldOffset(74)]
        public ushort Job;

        [FieldOffset(76)]
        public uint Key;

        [FieldOffset(80)]
        private fixed sbyte szMac[16];

        public string CharacterName { get { fixed (sbyte* bp = szCharacterName) { return new string(bp); } } }
        public string MacAddress { get { fixed (sbyte* bp = szMac) { return new string(bp); } } }
    }
}
